package roborally;

/**
 * An enumeration of all the possible directions at which the robot can face.
 * 
 * @author Thomas De Wachter & Tijs Delvaux
 *
 */
public enum Direction {
	UP, RIGHT, DOWN, LEFT;
	
	public int getNumber(){
		return this.ordinal();
	}
	
	public Direction getNext(){
		if(this.ordinal() < Direction.values().length - 1){
			return Direction.values()[this.ordinal() + 1];
		}else{
			return UP;
		}
	}
	
	public Direction getPrevious(){
		if(this.ordinal() > 0){
			return Direction.values()[this.ordinal() - 1];
		}else{
			return LEFT;
		}
	}
}
